import { useUser } from '@/pinia-store/user';
/**
 * @directive 权限节点显示，传入权限参数
 * **/
export const authority =  {
  created(el, binding) {
    let flag = useUser().authSignList.findIndex(item=>item === binding.value)
    if (flag===-1) {
      el.style.display = 'none';
    }
  },
  mounted(el, binding) {
    let flag = useUser().authSignList.findIndex(item=>item === binding.value)
    if (flag===-1) {
      el.remove()
    }
  },
}